DEBUG=yes
CFLAGS=-c -Wall
CC=gcc
LDFLAGS=
LDLIBS=-L/usr/local/lib -lpcre `xml2-config --cflags --libs`
COLLECTOR_DIR=collector/src/
COLLECTOR_BIN=collector/bin/
SOURCES= $(COLLECTOR_DIR)regex.c $(COLLECTOR_DIR)matchers.c $(COLLECTOR_DIR)indexer.c $(COLLECTOR_DIR)xmlParser.c $(COLLECTOR_DIR)collector.c $(COLLECTOR_DIR)main.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=$(COLLECTOR_BIN)fiem_collector

all: $(SOURCES) $(EXECUTABLE)
	
$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LDLIBS)

.c.o:
	$(CC) $(CFLAGS) $< -o $@ $(LDLIBS)

clean: rm -rf $(EXECUTABLE) $(OBJECTS)
